package bairui.international.console.web.controller.order.product;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.ResponseBody;

import com.lianjing.sh.spring.web.controller.base.action.Action;
import com.lianjing.sh.spring.web.controller.enhance.output.FomatOutput;

import bairui.international.model.domain.jpa.TB_BranchCompany;
import bairui.international.service.Service_ProductOrder;

/**
 *
 * 指派分公司
 *
 * @generated
 * 
 * @see STest_C_ProductOrder_Assign_Assign 测试
 *
 */
@Controller
public class C_ProductOrder_Assign_Assign
 extends SC_ProductOrder_Assign_Assign 
{
	
	@Autowired private Service_ProductOrder service_ProductOrder;
	
	/**
	 * 指派分公司
	 */
	@Action(Assign.class)
	@GetMapping(Assign.RequestMappingValue)
	public @FomatOutput @ResponseBody Object assign(
		ModelMap map, HttpServletRequest request, 
		@PathVariable(name=Assign.PathVariableName.Id) long id, 
		@PathVariable(name=Assign.PathVariableName.CompanyId) long companyId
	) throws Exception {
		service_ProductOrder.assignBranchCompany(id, new TB_BranchCompany(companyId));
		//
		return null;
	}
	

}
